#ifndef XML_PARSER_H
#define XML_PARSER_H

#include <string>

namespace Tvimeg
{
	class File;
	class XMLAttributes;

	class XMLParser
	{
	public:
		XMLParser(void);
		virtual ~XMLParser(void);

		bool			Parse(const File& file);

	protected:
		virtual void	StartElement(const std::string& elementName, const XMLAttributes& attributes) = 0;
		virtual void	EndElement(const std::string& elementName) = 0;
		virtual void	CharacterData(const std::string& string) = 0;

	private:
		static void		StartElementHandler(void* parser, const char* elementName, const char** attributes);
		static void		EndElementHandler(void* parser, const char* elementName);
		static void		CharacterDataHandler(void* parser, const char* string, int length);

		class XMLParserData;
		XMLParserData*	parserData;
	};
}

#endif // XML_PARSER_H
